# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=wl-mirror
pkgver=0.14.2
pkgrel=1
pkgdesc="a simple Wayland output mirror client"
url="https://github.com/Ferdi265/wl-mirror"
arch=(loong64 x86_64)
license=(GPL-3.0-or-later)
depends=(
  bash
  glibc
  libglvnd
  wayland
)
makedepends=(
  cmake
  ninja
  scdoc
)
optdepends=(
  'dmenu: for interactive selection of options and wl-present'
  'pipectl: for wl-present'
  'rofi: for interactively selecting options and wl-present'
  'slurp: for selecting regions and outputs and wl-present'
)
source=($pkgname-$pkgver.tar.gz::$url/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz)
sha512sums=('adf86ddb6797cfbe30ffb2b37b6749ea3fa3509e4c138c5a47dd89a52af6755366af99c74ea71536676c53fb81f1c52df22dd5eca78f4003351a65f1b7c3f93f')
b2sums=('08fc723857d98c29a2ead3a0fb1a3b353a9231d8e75296ca6a220bc5586941c4900cc8cc7ba1e20576d98cdbe86dac9f9fab5cd6b90c85f49e16cb3aae024365')

build() {
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -D INSTALL_EXAMPLE_SCRIPTS=ON
    -D INSTALL_DOCUMENTATION=ON
    -G Ninja
    -S $pkgname-$pkgver
    -W no-dev
    )

  cmake "${cmake_options[@]}"
  cmake --build build --verbose
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
